/**
 * Copyright By Nanjing Fujitsu Nanda Software Technology Co., Ltd
 * 下午6:28:13
 * DateUtils.java
 * 
 */
package com.fujitsu.nanjing.mobile.common;

import java.util.Calendar;
import java.util.Date;

/**
 * @author qixb.fnst
 * 
 */
public class DateUtils {

    private static Calendar calendar=Calendar.getInstance();
    public static Date getBeginTimeOfNextDay(Date date) {
        calendar.setTime(date);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        return calendar.getTime();
    }

    public static Date getBeginTimeOfDay(Date date) {
        calendar.setTime(date);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.DATE, calendar.get(Calendar.DATE)+1);
        return calendar.getTime();
    }
}
